﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SistemaAcademicoDAL;
using SistemaAcademicoBO.Entities;
using SistemaAcademicoBO;

namespace SistemaAcademicoBLL.Managers
{
    class ProfessorManager
    {
        private ProfessorDAO professorDAO;

        public ProfessorManager()
        {
            professorDAO = new ProfessorDAO();
        }

        public Professor GetProfessor(int id)
        {
            return (Professor)professorDAO.GetRecord(id);
        }

        public List<Professor> GetAllProfessors()
        {
            List<IEntity> entityList = professorDAO.GetAllRecords();
            List<Professor> professorList = new List<Professor>();
            foreach (IEntity entity in entityList)
            {
                professorList.Add((Professor)entity);
            }

            return professorList;
        }

        public void SetProfessor(Professor professor)
        {
            professorDAO.SetRecord(professor);
        }

        public void RemoveProfessor(int id)
        {
            professorDAO.RemoveRecord(id);
        }
    }
}
